#pragma once
#include "Stdafx.h"
#include "Pascal.h"
#include "wc3main.h"
#include "wc3collections.h"
#include "wc3agent.h"
#include "wc3_game_state.h"
#include "wc3player.h"
#include "wc3jassvm.h"
#include "wc3memory.h"
#include "wc3string.h"
#include "wc3props.h"
#include "wc3refcnt.h"
#include "wc3observer.h"
#include "jassvmhooks.h"
#include "myjassvm.h"
#include "debug_logger.h"
#include "jassvm_extension.h"
extern HMODULE GameDll;
extern THandlerCallbacks * InitHandlers;
extern THandlerCallbacks * InitDoneHandlers;
extern PAgileData* ppAgileData;
extern Pointer p_TStringManager_VMT;
extern PRCString p_TRCString_VMT;
extern PStringManager* ppStringManager;
extern PStringRep pNullRep;
extern PRefCnt_VMT p_TRefCnt_VMT;

extern _RegisterNative_1 _RegisterNative;
extern _Compile_1 _Compile;
extern _FreeScript_1 _FreeScript;
extern _CreateInstance_1 _CreateInstance;
extern _RegisterInstance_1 _RegisterInstance;
extern _FreeInstance_1 _FreeInstance;
extern _RunInstance_1 _RunInstance;
extern _CloneInstance_1 _CloneInstance;
extern _Instance_Run_1 _Instance_Run;
extern _Instance_CallCode_1 _Instance_CallCode;
extern _Instance_ExecuteFunctionWithOptionalInit_1 _Instance_ExecuteFunctionWithOptionalInit;
extern _ExecuteFunctionByHandle_1 _ExecuteFunctionByHandle;
extern _Instance_GetStringHandle_1 _Instance_GetStringHandle;

extern Pointer JassArray_VMT;

extern SStrHash64_1 SStrHash64;
extern SStrHash32_1 SStrHash32;
extern _CObserver_Unsubscribe_1 _CObserver_Unsubscribe;
extern _GetWc3Prop_1 _GetWc3Prop;
extern SMemAlloc_1 SMemAlloc;
extern SMemFree_1 SMemFree;
extern SMemReAlloc_1 SMemReAlloc;

extern TInstanceEventCallback pOnInstanceCreated;
extern TInstanceEventCallback pOnInstanceDestroying;
extern TInstanceEventCallback pOnInstanceInit;
extern TInstanceExecuteFunctionByNameCallback pOnExecuteFunctionByName;
extern TInstanceExecuteFunctionByHandleCallback pOnExecuteFunctionByHandle;
extern TInstanceGetStringHandleCallback pOnInstanceGetStringHandle;
extern TEnableVarChangeEventCallback pOnEnableVarChangeEvent;

extern orig_RegisterInstance_1 orig_RegisterInstance;
extern orig_FreeInstance_1 orig_FreeInstance;
extern orig_Instance_ExecuteFunctionWithOptionalInit_1 orig_Instance_ExecuteFunctionWithOptionalInit;
extern orig_ExecuteFunctionByHandle_1 orig_ExecuteFunctionByHandle;
extern orig_Instance_GetStringHandle_1 orig_Instance_GetStringHandle;
extern orig_CGameState_ConnectToVarChangeEvent_1 orig_CGameState_ConnectToVarChangeEvent;

extern TEnvironmentData JassEnvironment;


extern PJumpTable _pJumpTable;
extern TJumpTable JumpTableCopy;

extern orig_Compile_1 orig_Compile;

extern TLogger Logger;

	//extern TStringList Blacklist;
extern TFunctionTables FunctionTables;
extern Integer IgnoreLevel;

	//extern TAnsiStringBuilderHack StringBuilder;

extern TInstanceToScriptTable InstanceToScriptTable;
extern TScriptToFuncTable ScriptToFuncTable;